04. View Groups & View Hierarchy

ANDK L2 04 View Groups HS-A

View Groups

Which of the following are view groups? Check the correct answers.

SOLUTION:
  • LinearLayout
  • ConstraintLayout
  • ScrollView

View groups and layout

QUIZ QUESTION::

Match the ViewGroup purpose on the left to its ViewGroup name on the right.

ANSWER CHOICES:



ViewGroup Purpose

ViewGroups

ViewGroup to use when you need to scroll a single view vertically.

ViewGroup to use for a strictly horizontal list-style arrangement of views.

ViewGroup that is useful for a strictly vertical list-style arrangement of views.

A ViewGroup where elements can be arranged freely, are placed by the system based on constraints, and may adapt in size based on screen size and orientation.

SOLUTION:

ViewGroup Purpose

ViewGroups

ViewGroup to use for a strictly horizontal list-style arrangement of views.

A ViewGroup where elements can be arranged freely, are placed by the system based on constraints, and may adapt in size based on screen size and orientation.

ViewGroup that is useful for a strictly vertical list-style arrangement of views.

ViewGroup to use when you need to scroll a single view vertically.

View hierarchies

One of the listed view hierarchies shown is not valid.
Select the invalid view hierarchy.

SOLUTION: TextView > TextView, ImageView, ScrollView